/***************************************************************************************************
 * 单位：北京红云融通技术有限公司
 * 日期：2016-12-14
 * 版本：1.0.0
 * 版权：All rights reserved.
 **************************************************************************************************/
package com.yingda.electronicscaleadvices.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
    public static final String TAG = "DateUtil";

    //获取年月日
    public static String yearsTime(){
        SimpleDateFormat   formatter   =   new   SimpleDateFormat   ("yyyy-MM-dd");
        Date curDate =  new Date(System.currentTimeMillis());
        String time = formatter.format(curDate);
        return time + "  " + hourTime() +"  " + weekTime() ;

    }
    //时分秒时间的获取
    public static String hourTime(){
        SimpleDateFormat   formatter   =   new   SimpleDateFormat   ("HH:mm:ss");
        Date curDate =  new Date(System.currentTimeMillis());
        String time = formatter.format(curDate);
        return time;
    }

    //获取今天礼拜几
    public static String weekTime(){
        SimpleDateFormat   formatter   =   new   SimpleDateFormat   ("EEEE");
        Date curDate =  new Date(System.currentTimeMillis());
        String time = formatter.format(curDate);
        return time;
    }

    public static String years(){
        SimpleDateFormat   formatter   =   new   SimpleDateFormat   ("yyyy-MM-dd");
        Date curDate =  new Date(System.currentTimeMillis());
        String time = formatter.format(curDate);
        return time ;
    }


    public static Date getData(String time) throws ParseException {
        SimpleDateFormat   formatter   =   new   SimpleDateFormat   ("yyyy-MM-dd");
        Date curDate =  formatter.parse(time);

        return curDate ;
    }

    public static long getCurrentTime(){
//        SimpleDateFormat   formatter   =   new   SimpleDateFormat   ("ss");
//        Date curDate =  new Date(System.currentTimeMillis());
//        String time = formatter.format(curDate);
//        return Integer.valueOf(time) ;

        return System.currentTimeMillis() / 1000;
    }



}
